#region license
# This file is part of Grawlix.
# 
# Grawlix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
# 
# Grawlix is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public
# License along with Grawlix.  If not, see
# <http://www.gnu.org/licenses/>.
#endregion

"""Untyped reference type equality testing."""

namespace Grawlix.Meta.Tests.Equality
import Grawlix.Meta
import NUnit.Framework

[TestFixture]
class UntypedObjectEqualityFixture(EqualityAttributeTestCase):

#region aO
	
	[Test]
	def EqualsAO():
		expect aO, \
				_.Equals(a), \
			not	_.Equals(b), \
			not	_.Equals(c), \
				_.Equals(d), \
				_.Equals(w), \
			not	_.Equals(x), \
			not	_.Equals(y), \
				_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
				_.Equals(aO), \
			not	_.Equals(bO), \
			not	_.Equals(cO), \
				_.Equals(dO), \
				_.Equals(wO), \
			not	_.Equals(xO), \
			not	_.Equals(yO), \
				_.Equals(zO), \
			/* No overload. */ \
		/*		_.Equals(aE), */ \
		/*	not	_.Equals(aU), */ \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorAO():
		expect aO, \
				_ == a, \
			not	_ == b, \
			not	_ == c, \
				_ == d, \
				_ == w, \
			not	_ == x, \
			/* Currently Boo resolves this oddly */ \
				_ == y, \
				_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
				_ == aO, \
			not	_ == bO, \
			not	_ == cO, \
				_ == dO, \
				_ == wO, \
			not	_ == xO, \
			/* Currently Boo resolves this oddly */ \
				_ == yO, \
				_ == zO, \
			not	_ == oN, \
				_ == aE, \
			not	_ == aU, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorAO():
		expect aO, \
			not	_ != a, \
				_ != b, \
				_ != c, \
			not	_ != d, \
			not	_ != w, \
				_ != x, \
			/* Currently Boo resolves this oddly */ \
			not	_ != y, \
			not	_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
			not	_ != aO, \
				_ != bO, \
				_ != cO, \
			not	_ != dO, \
			not	_ != wO, \
				_ != xO, \
			/* Currently Boo resolves this oddly */ \
			not	_ != yO, \
			not	_ != zO, \
				_ != oN, \
			not	_ != aE, \
				_ != aU, \
				_ != null

#endregion

#region bO
	
	[Test]
	def EqualsBO():
		expect bO, \
			not	_.Equals(a), \
				_.Equals(b), \
			not	_.Equals(c), \
			not	_.Equals(d), \
			not	_.Equals(w), \
			not	_.Equals(x), \
			not	_.Equals(y), \
			not	_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
			not	_.Equals(aO), \
				_.Equals(bO), \
			not	_.Equals(cO), \
			not	_.Equals(dO), \
			not	_.Equals(wO), \
			not	_.Equals(xO), \
			not	_.Equals(yO), \
			not	_.Equals(zO), \
			/* No overload. */ \
		/*		_.Equals(bE), */ \
		/*	not	_.Equals(bU), */ \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorBO():
		expect bO, \
			not	_ == a, \
				_ == b, \
			not	_ == c, \
			not	_ == d, \
			not	_ == w, \
			not	_ == x, \
			not	_ == y, \
			not	_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
			not	_ == aO, \
				_ == bO, \
			not	_ == cO, \
			not	_ == dO, \
			not	_ == wO, \
			not	_ == xO, \
			not	_ == yO, \
			not	_ == zO, \
			not	_ == oN, \
				_ == bE, \
			not	_ == bU, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorBO():
		expect bO, \
				_ != a, \
			not	_ != b, \
				_ != c, \
				_ != d, \
				_ != w, \
				_ != x, \
				_ != y, \
				_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
				_ != aO, \
			not	_ != bO, \
				_ != cO, \
				_ != dO, \
				_ != wO, \
				_ != xO, \
				_ != yO, \
				_ != zO, \
				_ != oN, \
			not	_ != bE, \
				_ != bU, \
				_ != null

#endregion

#region cO
	
	[Test]
	def EqualsCO():
		expect cO, \
			not	_.Equals(a), \
			not	_.Equals(b), \
			/* Reference equality. */ \
			not	_.Equals(c), \
			not	_.Equals(d), \
				_.Equals(w), \
			not	_.Equals(x), \
			not	_.Equals(y), \
			not	_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
			not	_.Equals(aO), \
			not	_.Equals(bO), \
				_.Equals(cO), \
			not	_.Equals(dO), \
				_.Equals(wO), \
			not	_.Equals(xO), \
			not	_.Equals(yO), \
			not	_.Equals(zO), \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorCO():
		expect cO, \
			not	_ == a, \
			not	_ == b, \
			/* Reference equality. */ \
			not	_ == c, \
			not	_ == d, \
				_ == w, \
			not	_ == x, \
			not	_ == y, \
			not	_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
			not	_ == aO, \
			not	_ == bO, \
				_ == cO, \
			not	_ == dO, \
				_ == wO, \
			not	_ == xO, \
			not	_ == yO, \
			not	_ == zO, \
			not	_ == oN, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorCO():
		expect cO, \
				_ != a, \
				_ != b, \
				/* Reference equality. */ \
				_ != c, \
				_ != d, \
			not	_ != w, \
				_ != x, \
				_ != y, \
				_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
				_ != aO, \
				_ != bO, \
			not	_ != cO, \
				_ != dO, \
			not	_ != wO, \
				_ != xO, \
				_ != yO, \
				_ != zO, \
				_ != oN, \
				_ != null

#endregion

#region dO
	
	[Test]
	def EqualsDO():
		expect dO, \
			not	_.Equals(a), \
			not	_.Equals(b), \
			not	_.Equals(c), \
			/* Reference equality. */ \
			not	_.Equals(d), \
			not	_.Equals(w), \
			not	_.Equals(x), \
			not	_.Equals(y), \
			not	_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
			not	_.Equals(aO), \
			not	_.Equals(bO), \
			not	_.Equals(cO), \
				_.Equals(dO), \
			not	_.Equals(wO), \
			not	_.Equals(xO), \
			not	_.Equals(yO), \
			not	_.Equals(zO), \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorDO():
		expect dO, \
				_ == a, \
			not	_ == b, \
			not	_ == c, \
			/* Reference equality. */ \
			not	_ == d, \
				_ == w, \
			not	_ == x, \
			not	_ == y, \
			not	_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
				_ == aO, \
			not	_ == bO, \
			not	_ == cO, \
				_ == dO, \
				_ == wO, \
			not	_ == xO, \
			not	_ == yO, \
			not	_ == zO, \
			not	_ == oN, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorDO():
		expect dO, \
			not	_ != a, \
				_ != b, \
				_ != c, \
				/* Reference equality. */ \
				_ != d, \
			not	_ != w, \
				_ != x, \
				_ != y, \
				_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
			not	_ != aO, \
				_ != bO, \
				_ != cO, \
			not	_ != dO, \
			not	_ != wO, \
				_ != xO, \
				_ != yO, \
				_ != zO, \
				_ != oN, \
				_ != null

#endregion

